package org.xukai.remoting.ws.jsonsoap;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import java.util.Arrays;
import java.util.List;

/**
 * @author xukai
 * @desc
 * @date 2016-09-27-下午 6:19
 */
public class cxfJsonTest {

    public static void main(String[] args) {

        JaxWsProxyFactoryBean fac = new JaxWsProxyFactoryBean();
        fac.setServiceClass(JsonService.class);
        fac.setAddress("http://127.0.0.1:8076/webServices2?groupName=test_20160927");
        fac.getOutInterceptors().add(new HeardInterceptor());

        fac.getInInterceptors().add(new LoggingInInterceptor());
        fac.getOutInterceptors().add(new LoggingOutInterceptor());
        JsonService sv = (JsonService) fac.create();

        String res = sv.demo("{'startDate':'20150615'}");

        System.out.println(res);

    }
}
